<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta charset="UTF-8">
<title sec:authentication="name"></title>
<link rel="stylesheet" th:href="@{webjars/bootstrap/3.3.7-1/css/bootstrap.css}">
<link rel="stylesheet" th:href="@{webjars/bootstrap/3.3.7-1/css/bootstrap-theme.css}">
<style type="text/css">
	body {
		padding-top: 50px;
	}
	.starter-template{
		padding: 40px 15px;
		text-align: center;
	}
</style>
</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="contrainer">
			<div class="navbar-header">
				<a class="navbar-brand" href="#">Spring Security 演示</a>
			</div>
			<div id="navbar" class="collapse navbar-collapse">
				<ul class="nav navbar-nav">
					<li><a th:href="@{/}">首页</a></li>
				</ul>
			</div>
		</div>
	</nav>
	
	<div class="contrainer">
		<div class="starter-template">
			<h1 th:text="${msg.title}"></h1>
			<p th:text="${msg.content}" class="bg-primary"></p>
			
			<div sec:authorize="hasRole('ROLE_ADMIN')">
				<p class="bg-info" th:text="${msg.etraInfo}"></p>
			</div>
			<div sec:authorize="hasRole('ROLE_USER')">
				<p class="bg-info">无更多信息</p>
			</div>
			<div sec:authorize="hasRole('ROLE_DBA')">
				<p class="bg-info">额外信息，DBA显示的内容</p>
			</div>
			<form action="/logout" method="post">
				<button type="submit" class="btn btn-privary">注销</button>
			</form>
		</div>
	</div>
</body>
</html>